//
//  Communal.swift
//  SinaWB_XY
//
//  Created by 小熊猫 on 15/10/10.
//  Copyright © 2015年 小熊猫. All rights reserved.
//

import Foundation
import UIKit

//定义宏
let SCREENW = UIScreen.mainScreen().bounds.width
let SCREENH = UIScreen.mainScreen().bounds.height

//公共的方法

func suijiColor() -> UIColor{
    return ColorDefine(r: CGFloat(random()%255), g: CGFloat(random()%255), b: CGFloat(random()%255))
}

func ColorDefine(r r:CGFloat,g:CGFloat,b:CGFloat) -> UIColor {
    return UIColor(red: r/255, green: g/255, blue: b/255, alpha: 1)
}


//自定义输出方法
func printLog<T>(message:T,error:Bool=false,funcName:String=__FUNCTION__,fileName:String=__FILE__,lineNum:Int=__LINE__){
    
    if error{
        print("\((fileName as NSString).lastPathComponent)[\(lineNum)],\(funcName):\(message)")
    }else{
        #if DEBUG
            print("\((fileName as NSString).lastPathComponent)[\(lineNum)],\(funcName):\(message)")
        #endif
    }
}




